var http=require("http");

/*
 http.get("http://study.163.com/",function (res) {
 var html="";
 res.on("data",function (data) {
 html+=data;
 console.log(data)
 });
 res.on("end",function () {
 console.log(html);
 })
 });*/

var hostname="localhost";
var prot=2000;
var server=http.createServer(function (req,res) {
    var resA=res;
    var html="";
    http.get("http://edu6.sdkhcm.com/",function (res) {
        res.on("data",function (data) {
            html+=data;
        });
        res.on("end",function () {
            resA.statusCode=200;
            resA.setHeader("Content-Type","text/html");//http 通用的请求头  text/plain 代表输入什么输出什么 text/html 输出页面格式

            resA.end(html);//输出
        })
    });


});
server.listen(prot);